<extend name="./Apps/Home/View/default/shops/layout.html" />
<block name="content">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/plugins/webuploader/style.css" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/plugins/webuploader/webuploader.css" />
<script type="text/javascript" src="__ROOT__/Apps/Home/View/default/js/shopsbatchupload.js"></script>
<style>


</style>
<script>
$(function () {
	$.formValidator.initConfig({
		   theme:'Default',mode:'AutoTip',formID:"myform",debug:true,submitOnce:true,onSuccess:function(){
			   setShop();
			   return false;
			},onError:function(msg){
	}});
	$("#shopKeywords").formValidator({onShow:"",onFocus:"请输入店铺SEO关键字",onCorrect:"输入正确"}).inputValidator({min:1,max:50,onError:"店铺SEO关键字不能为空,请确认"});
	var uploading = null;
	uploadFile({
    	  server:Think.U('Home/shops/uploadPic'),pick:'#shopBannerPicker',
    	  formData: {dir:'shops'},
    	  callback:function(f){
    		  layer.close(uploading);
    		  var json = WST.toJson(f);
    		  $('#shopBannerPreview').attr('src',WST.DOMAIN+"/"+json.file.savepath+json.file.savethumbname);
    		  $('#shopBanner').val(json.file.savepath+json.file.savename);
    		  $('#shopBannerPreview').show();
	      },
	      progress:function(rate){
	    	  uploading = WST.msg('正在上传图片，请稍后...');
	      }
    });    
});

function imglimouseover(obj){
	if(!$(obj).find('.file-panel').html()){
		$(obj).find('.setdel').addClass('trconb');
		$(obj).find('.setdel').css({"display":""});
	}
}

function imglimouseout(obj){
	
	$(obj).find('.setdel').removeClass('trconb');
	$(obj).find('.setdel').css({"display":"none"});
}

function imglidel(obj){
	if (confirm('是否删除图片?')) {
		$(obj).parent().remove("li");
		return;
	}
}
</script>
   <div class="wst-body" style="position:relative;"> 
       <div class='wst-page-header'>卖家中心 > 店铺设置</div>
       <div class='wst-page-content'>
       
       <form name="myform" method="post" id="myform" autocomplete="off">
       	<input type='hidden' id='id' value='0'/>
        <input type='hidden' id='shopBanner' value='{$object.shopBanner}'/>
        <table class="table table-hover table-striped table-bordered wst-form">
            <!-- tr >
             <th width='120' align='right'>店铺SEO标题<font color='red'>*</font>：</th>
             <td><input type='text' id='shopTitle' class="form-control wst-ipt" value='{$object.shopTitle}' style='width:250px;' maxLength='25'/></td>
           </tr -->
           <tr>
             <th width='120' align='right'>店铺SEO关键字<font color='red'>*</font>：</th>
             <td><input type='text' id='shopKeywords' class="form-control wst-ipt" value='{$object.shopKeywords}' style='width:350px;' maxLength='25'/></td>
           </tr>
           <tr>
	         <th width='120'>店铺SEO描述：</th>
	         <td colspan='3'>
	             <textarea rows="2" style='width:350px;' id='shopDesc' name='shopDesc' >{$object.shopDesc}</textarea>
	         </td>
	      </tr>
           <tr style="height:80px">
             <th width='120' align='right' valign='top'>顶部广告：</th>
             <td>
                <div id="shopBannerPicker" style='margin-left:0px;margin-top:5px;height:30px;overflow:hidden'>上传顶部广告图片</div>
             	<div>图片大小:1400 x 120 (px)(格式为 gif, jpg, jpeg, png)</div>
             	<div style="margin-top:5px;">
             		<img height="60" id='shopBannerPreview' <if condition="$object.shopBanner neq ''">src="__ROOT__/{$object.shopBanner}"<else />src="__ROOT__/Apps/Home/View/default/images/s.gif"</if>/>
             	</div>
             </td>
           </tr>
           <tr>
             <th width='120' align='right'>滚动广告<font color='red'>*</font>：</th>
             <td>
             	
		       <div id='galleryImgs' class='wst-gallery-imgs'>
		        
		       	 <if condition="count($object['shopAds']) eq 0" >
                       <div id="wrapper">
                           <div id="container">
                           	<div style="" class="statusBar">
                            	图片大小:1400 x 350 (px)(格式为 gif, jpg, jpeg, png)
                    		</div>
                       
            <!--头部，相册选择和格式选择-->
                              <div id="uploader">
                               <div class="queueList">
                                   <div id="dndArea" class="placeholder">
                                      <div id="filePicker"></div>
                                      </div>
                                   <ul class="filelist"></ul>
                               </div>
                             <div class="statusBar" style="display:none">
                               <div class="progress">
                                    <span class="text">0%</span>
                                    <span class="percentage"></span>
                               </div>
                                    <div class="info"></div>
                               <div class="btns">
                                 <div id="filePicker2" class="webuploader-containe webuploader-container"></div><div class="uploadBtn state-finish">开始上传</div>
                               </div>
                            </div>
                         </div>
                      </div>
                   </div>
               <else/>
               	<div id="wrapper">
                       <div id="container">
                       		<div style="border-bottom:1px solid #dadada;padding-left:10px; ">
                          		图片大小:1400 x 350 (px)(格式为 gif, jpg, jpeg, png)
                   			</div>
                          	<div id="uploader">
                             <div class="queueList">
                                 <div id="dndArea" class="placeholder element-invisible">
                                    <div id="filePicker" class="webuploader-container"></div>
                                    </div>
                                 <ul class="filelist">
                                 	<volist name="object['shopAds']" id="vo" key='i'>
								       <li style="border: 1px solid rgb(59, 114, 165)" order="100" onmouseover="imglimouseover(this)" onmouseout="imglimouseout(this)">
								       		<input type="hidden" class="gallery-img" iv="{$vo.adImg_thumb}" v="{$vo.adImg}" />
									       <img width="152" height="152" src="__ROOT__/{$vo.adImg_thumb}"><span class="setdef" style="display:none">默认</span><span class="setdel" onclick="imglidel(this)" style="display:none">删除</span>
								       	   <input class="gallery-img-url"  placeholder="广告路径" type="text" style="width:118px;" value="{$vo.adUrl}"/>
								       </li>
									</volist>
								       
                                 	
                                 </ul>
                            </div>
                            <div class="statusBar" style="">
                               <div class="progress">
                                    <span class="text"></span>
                                    <span class="percentage"></span>
                               </div>
                               <div class="info"></div>
                               <div class="btns">
                                  <div id="filePicker2" class="webuploader-containe webuploader-container"></div>
                                  <div class="uploadBtn state-finish">开始上传</div>
                               </div>
                            </div>
                        </div>
                    </div>
                 </div>
               </if>
		       
		       </div>
		       <div style='clear:both;'></div>
             </td>
           </tr>
           <tr>
             <td colspan='2' style='text-align:center;padding:20px;'>
                 <button type="submit" class='wst-btn-query'>保&nbsp;存</button>&nbsp;&nbsp;
                 <button type="button" class='wst-btn-query' onclick='javascript:location.reload();'>重&nbsp;置</button>
             </td>
           </tr>
        </table>
       </form>
       </div>
   </div>
</block>  
